.class public Lcom/instagram/android/creation/widget/SliderView;
.super Landroid/widget/HorizontalScrollView;
.source "SliderView.java"


# instance fields
.field private a:Lcom/instagram/android/creation/widget/h;

.field private b:F

.field private c:Z

.field private d:Z

.field private e:F

.field private f:Z

.field private g:Z

.field private h:I

.field private i:Z

.field private j:F

.field private k:F

.field private l:Lcom/instagram/android/creation/widget/AngleRulerView;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter "context"

    .prologue
    const/4 v0, 0x0

    .line 37
    invoke-direct {p0, p1}, Landroid/widget/HorizontalScrollView;-><init>(Landroid/content/Context;)V

    .line 20
    iput-boolean v0, p0, Lcom/instagram/android/creation/widget/SliderView;->c:Z

    .line 31
    iput-boolean v0, p0, Lcom/instagram/android/creation/widget/SliderView;->i:Z

    .line 32
    const/high16 v0, -0x4080

    iput v0, p0, Lcom/instagram/android/creation/widget/SliderView;->j:F

    .line 33
    const/high16 v0, 0x3f80

    iput v0, p0, Lcom/instagram/android/creation/widget/SliderView;->k:F

    .line 38
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .parameter "context"
    .parameter "attrs"

    .prologue
    const/4 v0, 0x0

    .line 41
    invoke-direct {p0, p1, p2}, Landroid/widget/HorizontalScrollView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 20
    iput-boolean v0, p0, Lcom/instagram/android/creation/widget/SliderView;->c:Z

    .line 31
    iput-boolean v0, p0, Lcom/instagram/android/creation/widget/SliderView;->i:Z

    .line 32
    const/high16 v0, -0x4080

    iput v0, p0, Lcom/instagram/android/creation/widget/SliderView;->j:F

    .line 33
    const/high16 v0, 0x3f80

    iput v0, p0, Lcom/instagram/android/creation/widget/SliderView;->k:F

    .line 42
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 1
    .parameter "context"
    .parameter "attrs"
    .parameter "defStyle"

    .prologue
    const/4 v0, 0x0

    .line 45
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/HorizontalScrollView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 20
    iput-boolean v0, p0, Lcom/instagram/android/creation/widget/SliderView;->c:Z

    .line 31
    iput-boolean v0, p0, Lcom/instagram/android/creation/widget/SliderView;->i:Z

    .line 32
    const/high16 v0, -0x4080

    iput v0, p0, Lcom/instagram/android/creation/widget/SliderView;->j:F

    .line 33
    const/high16 v0, 0x3f80

    iput v0, p0, Lcom/instagram/android/creation/widget/SliderView;->k:F

    .line 46
    return-void
.end method

.method private c(F)F
    .locals 2
    .parameter

    .prologue
    const/high16 v1, 0x4120

    .line 88
    iget-object v0, p0, Lcom/instagram/android/creation/widget/SliderView;->l:Lcom/instagram/android/creation/widget/AngleRulerView;

    invoke-virtual {v0}, Lcom/instagram/android/creation/widget/AngleRulerView;->getMaximumAngle()F

    move-result v0

    mul-float/2addr v0, p1

    mul-float/2addr v0, v1

    invoke-static {v0}, Ljava/lang/Math;->round(F)I

    move-result v0

    int-to-float v0, v0

    div-float/2addr v0, v1

    return v0
.end method

.method private d(F)F
    .locals 2
    .parameter

    .prologue
    .line 92
    const/high16 v0, 0x4000

    iget-object v1, p0, Lcom/instagram/android/creation/widget/SliderView;->l:Lcom/instagram/android/creation/widget/AngleRulerView;

    invoke-virtual {v1}, Lcom/instagram/android/creation/widget/AngleRulerView;->getMaximumAngle()F

    move-result v1

    mul-float/2addr v0, v1

    div-float v0, p1, v0

    return v0
.end method

.method private d()V
    .locals 2

    .prologue
    .line 203
    invoke-virtual {p0}, Lcom/instagram/android/creation/widget/SliderView;->b()V

    .line 205
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/instagram/android/creation/widget/SliderView;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/instagram/android/creation/widget/AngleRulerView;

    iput-object v0, p0, Lcom/instagram/android/creation/widget/SliderView;->l:Lcom/instagram/android/creation/widget/AngleRulerView;

    .line 208
    iget-object v0, p0, Lcom/instagram/android/creation/widget/SliderView;->l:Lcom/instagram/android/creation/widget/AngleRulerView;

    invoke-virtual {v0}, Lcom/instagram/android/creation/widget/AngleRulerView;->getLeft()I

    move-result v0

    iget-object v1, p0, Lcom/instagram/android/creation/widget/SliderView;->l:Lcom/instagram/android/creation/widget/AngleRulerView;

    invoke-virtual {v1}, Lcom/instagram/android/creation/widget/AngleRulerView;->getRight()I

    move-result v1

    add-int/2addr v0, v1

    invoke-virtual {p0}, Lcom/instagram/android/creation/widget/SliderView;->getWidth()I

    move-result v1

    sub-int/2addr v0, v1

    div-int/lit8 v0, v0, 0x2

    .line 210
    invoke-virtual {p0}, Lcom/instagram/android/creation/widget/SliderView;->getScrollY()I

    move-result v1

    invoke-virtual {p0, v0, v1}, Lcom/instagram/android/creation/widget/SliderView;->scrollTo(II)V

    .line 212
    invoke-virtual {p0}, Lcom/instagram/android/creation/widget/SliderView;->getScrollX()I

    move-result v0

    invoke-virtual {p0}, Lcom/instagram/android/creation/widget/SliderView;->getWidth()I

    move-result v1

    div-int/lit8 v1, v1, 0x2

    add-int/2addr v0, v1

    iput v0, p0, Lcom/instagram/android/creation/widget/SliderView;->h:I

    .line 213
    invoke-virtual {p0}, Lcom/instagram/android/creation/widget/SliderView;->a()V

    .line 214
    iget-object v0, p0, Lcom/instagram/android/creation/widget/SliderView;->l:Lcom/instagram/android/creation/widget/AngleRulerView;

    invoke-virtual {v0}, Lcom/instagram/android/creation/widget/AngleRulerView;->getWidth()I

    move-result v0

    int-to-float v0, v0

    iput v0, p0, Lcom/instagram/android/creation/widget/SliderView;->b:F

    .line 215
    return-void
.end method

.method private e(F)F
    .locals 1
    .parameter

    .prologue
    .line 96
    iget-object v0, p0, Lcom/instagram/android/creation/widget/SliderView;->l:Lcom/instagram/android/creation/widget/AngleRulerView;

    invoke-virtual {v0}, Lcom/instagram/android/creation/widget/AngleRulerView;->getMaximumAngle()F

    move-result v0

    div-float v0, p1, v0

    return v0
.end method


# virtual methods
.method public a()V
    .locals 1

    .prologue
    .line 189
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/instagram/android/creation/widget/SliderView;->c:Z

    .line 190
    return-void
.end method

.method public a(DZ)V
    .locals 3
    .parameter
    .parameter

    .prologue
    .line 79
    iget v0, p0, Lcom/instagram/android/creation/widget/SliderView;->b:F

    .line 80
    if-eqz p3, :cond_0

    .line 81
    const/high16 v1, 0x3f80

    invoke-virtual {p0}, Lcom/instagram/android/creation/widget/SliderView;->c()F

    move-result v2

    sub-float/2addr v1, v2

    mul-float/2addr v0, v1

    .line 83
    :cond_0
    float-to-double v0, v0

    mul-double/2addr v0, p1

    double-to-int v0, v0

    .line 84
    const/4 v1, 0x0

    invoke-virtual {p0, v0, v1}, Lcom/instagram/android/creation/widget/SliderView;->scrollBy(II)V

    .line 85
    return-void
.end method

.method public a(FF)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 57
    iput p1, p0, Lcom/instagram/android/creation/widget/SliderView;->j:F

    .line 58
    iput p2, p0, Lcom/instagram/android/creation/widget/SliderView;->k:F

    .line 59
    return-void
.end method

.method public a(FZ)V
    .locals 1
    .parameter
    .parameter

    .prologue
    .line 100
    iget-boolean v0, p0, Lcom/instagram/android/creation/widget/SliderView;->i:Z

    if-eqz v0, :cond_0

    .line 101
    invoke-direct {p0, p1}, Lcom/instagram/android/creation/widget/SliderView;->e(F)F

    move-result v0

    invoke-virtual {p0, v0, p2}, Lcom/instagram/android/creation/widget/SliderView;->b(FZ)V

    .line 108
    :goto_0
    return-void

    .line 104
    :cond_0
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/instagram/android/creation/widget/SliderView;->d:Z

    .line 105
    iput p1, p0, Lcom/instagram/android/creation/widget/SliderView;->e:F

    .line 106
    iput-boolean p2, p0, Lcom/instagram/android/creation/widget/SliderView;->f:Z

    goto :goto_0
.end method

.method public a(F)Z
    .locals 2
    .parameter

    .prologue
    .line 224
    invoke-virtual {p0}, Lcom/instagram/android/creation/widget/SliderView;->getWidth()I

    move-result v0

    int-to-float v0, v0

    const/high16 v1, 0x3e80

    mul-float/2addr v0, v1

    cmpg-float v0, p1, v0

    if-gez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public b()V
    .locals 1

    .prologue
    .line 193
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/instagram/android/creation/widget/SliderView;->c:Z

    .line 194
    return-void
.end method

.method public b(FZ)V
    .locals 5
    .parameter
    .parameter

    .prologue
    const/4 v4, 0x0

    const/high16 v3, 0x4000

    .line 276
    iget v0, p0, Lcom/instagram/android/creation/widget/SliderView;->k:F

    invoke-static {v0, p1}, Ljava/lang/Math;->min(FF)F

    move-result v0

    .line 277
    iget v1, p0, Lcom/instagram/android/creation/widget/SliderView;->j:F

    invoke-static {v1, v0}, Ljava/lang/Math;->max(FF)F

    move-result v0

    .line 281
    const/high16 v1, 0x3f80

    add-float/2addr v0, v1

    div-float/2addr v0, v3

    .line 282
    iget-object v1, p0, Lcom/instagram/android/creation/widget/SliderView;->l:Lcom/instagram/android/creation/widget/AngleRulerView;

    invoke-virtual {v1}, Lcom/instagram/android/creation/widget/AngleRulerView;->getLeft()I

    move-result v1

    int-to-float v1, v1

    iget-object v2, p0, Lcom/instagram/android/creation/widget/SliderView;->l:Lcom/instagram/android/creation/widget/AngleRulerView;

    invoke-virtual {v2}, Lcom/instagram/android/creation/widget/AngleRulerView;->getWidth()I

    move-result v2

    int-to-float v2, v2

    mul-float/2addr v0, v2

    add-float/2addr v0, v1

    invoke-virtual {p0}, Lcom/instagram/android/creation/widget/SliderView;->getWidth()I

    move-result v1

    int-to-float v1, v1

    div-float/2addr v1, v3

    sub-float/2addr v0, v1

    float-to-int v0, v0

    .line 287
    if-eqz p2, :cond_0

    .line 288
    invoke-virtual {p0, v0, v4}, Lcom/instagram/android/creation/widget/SliderView;->smoothScrollTo(II)V

    .line 292
    :goto_0
    return-void

    .line 290
    :cond_0
    invoke-virtual {p0, v0, v4}, Lcom/instagram/android/creation/widget/SliderView;->scrollTo(II)V

    goto :goto_0
.end method

.method public b(F)Z
    .locals 2
    .parameter

    .prologue
    .line 234
    invoke-virtual {p0}, Lcom/instagram/android/creation/widget/SliderView;->getWidth()I

    move-result v0

    int-to-float v0, v0

    const/high16 v1, 0x3f40

    mul-float/2addr v0, v1

    cmpl-float v0, p1, v0

    if-lez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public c()F
    .locals 2

    .prologue
    .line 244
    const/high16 v0, 0x3f80

    iget v1, p0, Lcom/instagram/android/creation/widget/SliderView;->k:F

    sub-float/2addr v0, v1

    return v0
.end method

.method public fling(I)V
    .locals 0
    .parameter "velocityX"

    .prologue
    .line 124
    return-void
.end method

.method public onLayout(ZIIII)V
    .locals 4
    .parameter "changed"
    .parameter "left"
    .parameter "top"
    .parameter "right"
    .parameter "bottom"

    .prologue
    const/4 v3, 0x0

    .line 164
    invoke-super/range {p0 .. p5}, Landroid/widget/HorizontalScrollView;->onLayout(ZIIII)V

    .line 165
    iget-boolean v0, p0, Lcom/instagram/android/creation/widget/SliderView;->i:Z

    if-nez v0, :cond_0

    .line 166
    invoke-direct {p0}, Lcom/instagram/android/creation/widget/SliderView;->d()V

    .line 167
    iget-object v0, p0, Lcom/instagram/android/creation/widget/SliderView;->l:Lcom/instagram/android/creation/widget/AngleRulerView;

    invoke-virtual {v0}, Lcom/instagram/android/creation/widget/AngleRulerView;->getMaximumAngle()F

    move-result v0

    .line 168
    const/high16 v1, -0x3e10

    div-float/2addr v1, v0

    const/high16 v2, 0x41f0

    div-float v0, v2, v0

    invoke-virtual {p0, v1, v0}, Lcom/instagram/android/creation/widget/SliderView;->a(FF)V

    .line 170
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/instagram/android/creation/widget/SliderView;->i:Z

    .line 173
    :cond_0
    iget-boolean v0, p0, Lcom/instagram/android/creation/widget/SliderView;->d:Z

    if-eqz v0, :cond_1

    .line 174
    iget v0, p0, Lcom/instagram/android/creation/widget/SliderView;->e:F

    invoke-direct {p0, v0}, Lcom/instagram/android/creation/widget/SliderView;->e(F)F

    move-result v0

    iget-boolean v1, p0, Lcom/instagram/android/creation/widget/SliderView;->f:Z

    invoke-virtual {p0, v0, v1}, Lcom/instagram/android/creation/widget/SliderView;->b(FZ)V

    .line 178
    iput-boolean v3, p0, Lcom/instagram/android/creation/widget/SliderView;->d:Z

    .line 179
    const/4 v0, 0x0

    iput v0, p0, Lcom/instagram/android/creation/widget/SliderView;->e:F

    .line 180
    iput-boolean v3, p0, Lcom/instagram/android/creation/widget/SliderView;->f:Z

    .line 182
    :cond_1
    return-void
.end method

.method public onMeasure(II)V
    .locals 4
    .parameter "widthMeasureSpec"
    .parameter "heightMeasureSpec"

    .prologue
    const/4 v3, 0x0

    .line 63
    invoke-super {p0, p1, p2}, Landroid/widget/HorizontalScrollView;->onMeasure(II)V

    .line 66
    invoke-virtual {p0}, Lcom/instagram/android/creation/widget/SliderView;->getChildCount()I

    move-result v0

    if-lez v0, :cond_0

    .line 67
    invoke-virtual {p0, v3}, Lcom/instagram/android/creation/widget/SliderView;->getChildAt(I)Landroid/view/View;

    move-result-object v1

    .line 68
    invoke-virtual {p0}, Lcom/instagram/android/creation/widget/SliderView;->getMeasuredWidth()I

    move-result v2

    .line 69
    invoke-virtual {v1}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v0

    check-cast v0, Landroid/widget/FrameLayout$LayoutParams;

    .line 71
    iget v0, v0, Landroid/widget/FrameLayout$LayoutParams;->height:I

    invoke-static {p2, v3, v0}, Lcom/instagram/android/creation/widget/SliderView;->getChildMeasureSpec(III)I

    move-result v0

    .line 72
    const/high16 v3, 0x4000

    invoke-static {v2, v3}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v2

    .line 74
    invoke-virtual {v1, v2, v0}, Landroid/view/View;->measure(II)V

    .line 76
    :cond_0
    return-void
.end method

.method protected onScrollChanged(IIII)V
    .locals 7
    .parameter "l"
    .parameter "t"
    .parameter "oldl"
    .parameter "oldt"

    .prologue
    const/4 v6, 0x0

    .line 248
    invoke-super {p0, p1, p2, p3, p4}, Landroid/widget/HorizontalScrollView;->onScrollChanged(IIII)V

    .line 249
    invoke-virtual {p0}, Lcom/instagram/android/creation/widget/SliderView;->getScrollX()I

    move-result v0

    int-to-double v0, v0

    invoke-virtual {p0}, Lcom/instagram/android/creation/widget/SliderView;->getWidth()I

    move-result v2

    int-to-double v2, v2

    const-wide/high16 v4, 0x4000

    div-double/2addr v2, v4

    add-double/2addr v0, v2

    double-to-int v0, v0

    .line 250
    iget-boolean v1, p0, Lcom/instagram/android/creation/widget/SliderView;->c:Z

    if-eqz v1, :cond_1

    .line 251
    iget v1, p0, Lcom/instagram/android/creation/widget/SliderView;->h:I

    sub-int/2addr v0, v1

    mul-int/lit8 v0, v0, 0x2

    int-to-float v0, v0

    iget v1, p0, Lcom/instagram/android/creation/widget/SliderView;->b:F

    div-float/2addr v0, v1

    .line 252
    iget v1, p0, Lcom/instagram/android/creation/widget/SliderView;->k:F

    cmpl-float v1, v0, v1

    if-lez v1, :cond_2

    .line 253
    iget v0, p0, Lcom/instagram/android/creation/widget/SliderView;->k:F

    invoke-virtual {p0, v0, v6}, Lcom/instagram/android/creation/widget/SliderView;->b(FZ)V

    .line 254
    iget v0, p0, Lcom/instagram/android/creation/widget/SliderView;->k:F

    .line 262
    :cond_0
    :goto_0
    iget-object v1, p0, Lcom/instagram/android/creation/widget/SliderView;->a:Lcom/instagram/android/creation/widget/h;

    if-eqz v1, :cond_1

    .line 263
    iget-object v1, p0, Lcom/instagram/android/creation/widget/SliderView;->a:Lcom/instagram/android/creation/widget/h;

    invoke-direct {p0, v0}, Lcom/instagram/android/creation/widget/SliderView;->c(F)F

    move-result v0

    invoke-interface {v1, v0}, Lcom/instagram/android/creation/widget/h;->a(F)V

    .line 266
    :cond_1
    return-void

    .line 255
    :cond_2
    iget v1, p0, Lcom/instagram/android/creation/widget/SliderView;->j:F

    cmpg-float v1, v0, v1

    if-gez v1, :cond_0

    .line 256
    iget v0, p0, Lcom/instagram/android/creation/widget/SliderView;->j:F

    invoke-virtual {p0, v0, v6}, Lcom/instagram/android/creation/widget/SliderView;->b(FZ)V

    .line 257
    iget v0, p0, Lcom/instagram/android/creation/widget/SliderView;->j:F

    goto :goto_0
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 4
    .parameter "event"

    .prologue
    const v2, 0x3dcccccd

    const/4 v3, 0x0

    .line 128
    invoke-super {p0, p1}, Landroid/widget/HorizontalScrollView;->onTouchEvent(Landroid/view/MotionEvent;)Z

    move-result v0

    .line 129
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v1

    packed-switch v1, :pswitch_data_0

    .line 156
    :goto_0
    iput-boolean v3, p0, Lcom/instagram/android/creation/widget/SliderView;->g:Z

    .line 159
    :goto_1
    return v0

    .line 132
    :pswitch_0
    const/4 v1, 0x1

    iput-boolean v1, p0, Lcom/instagram/android/creation/widget/SliderView;->g:Z

    goto :goto_1

    .line 136
    :pswitch_1
    iget-boolean v1, p0, Lcom/instagram/android/creation/widget/SliderView;->g:Z

    if-eqz v1, :cond_0

    .line 138
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v1

    invoke-virtual {p0, v1}, Lcom/instagram/android/creation/widget/SliderView;->a(F)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 139
    iget-object v1, p0, Lcom/instagram/android/creation/widget/SliderView;->a:Lcom/instagram/android/creation/widget/h;

    if-eqz v1, :cond_0

    .line 140
    invoke-direct {p0, v2}, Lcom/instagram/android/creation/widget/SliderView;->d(F)F

    move-result v1

    iget v2, p0, Lcom/instagram/android/creation/widget/SliderView;->b:F

    mul-float/2addr v1, v2

    float-to-int v1, v1

    mul-int/lit8 v1, v1, -0x1

    .line 142
    invoke-virtual {p0, v1, v3}, Lcom/instagram/android/creation/widget/SliderView;->scrollBy(II)V

    .line 153
    :cond_0
    :goto_2
    iput-boolean v3, p0, Lcom/instagram/android/creation/widget/SliderView;->g:Z

    goto :goto_0

    .line 144
    :cond_1
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v1

    invoke-virtual {p0, v1}, Lcom/instagram/android/creation/widget/SliderView;->b(F)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 145
    iget-object v1, p0, Lcom/instagram/android/creation/widget/SliderView;->a:Lcom/instagram/android/creation/widget/h;

    if-eqz v1, :cond_0

    .line 146
    invoke-direct {p0, v2}, Lcom/instagram/android/creation/widget/SliderView;->d(F)F

    move-result v1

    iget v2, p0, Lcom/instagram/android/creation/widget/SliderView;->b:F

    mul-float/2addr v1, v2

    float-to-int v1, v1

    .line 148
    invoke-virtual {p0, v1, v3}, Lcom/instagram/android/creation/widget/SliderView;->scrollBy(II)V

    goto :goto_2

    .line 129
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method

.method public setOnSlideListener(Lcom/instagram/android/creation/widget/h;)V
    .locals 0
    .parameter "listener"

    .prologue
    .line 185
    iput-object p1, p0, Lcom/instagram/android/creation/widget/SliderView;->a:Lcom/instagram/android/creation/widget/h;

    .line 186
    return-void
.end method
